<template>
  <div class="wrapper">
    <div class="wrapper_title">我的购物车</div>
    <template v-for="item in AllCart" :key="item.shopName">
      <ProductList :productLists="item.productList" :shopNames="item.shopName"/>
    </template>
  </div>
  <Docker :currentIndex="1"/>
</template>

<script>
import ProductList from '../../components/ProductList'
import Docker from '../../components/Docker'
import { useStore } from 'vuex'
export default {
  name: 'CartList',
  components:{ProductList,Docker},
  setup(){
    const store=useStore();
    let AllCart=store.state.cartList;
    for(let i in AllCart){
      for(let j in AllCart[i].productList){
        if(AllCart[i].productList[j].count==0){
          delete AllCart[i].productList[j]
        }
      }
    }
    console.log(AllCart);
    return{AllCart}
  }
  
}
</script>

<style lang="scss" scoped>
@import '../../style/viriables.scss';
.wrapper {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background-color: #eee;
  overflow-y: scroll;
  &_title{
    width: 100%;
    height: .46rem;
    text-align: center;
    line-height: .46rem;
    background-color: #fff;
    font-size: .16rem;
  }
}

</style>
<style lang="scss" scoped>

</style>